/**
 * @利用位异或交换两值
 *
 * @author	 wangshikun <wangshikun2010@gmail.com>
 * @copyright	(c) 2012 wangshikun <wangshikun2010@gmail.com>
 * @license	http://www.opensource.org/licenses/mit-license.php The MIT License
 * @package	default
 * @subpackage	default
 */

#include <stdio.h>

int main(void) {
	int i1 = 022, i2 = 045;

	printf("交换之前：i1 = %d, i2 = %d\n", i1, i2);

	i1 ^= i2;
	i2 ^= i1;
	i1 ^= i2;

	printf("交换之后：i1 = %d, i2 = %d\n", i1, i2);

	return 0;
}
